package com.ruoyi.activiti.domain.constant;

public class TaskAction {
    /**
     * 完成任务
     */
    public static final String COMPLETE = "COMPLETE";

    /**
     * 完成
     */
    public static final String COMPLETENAME = "发起申请";

    /**
     * 返回上一步
     */
    public static final String BACK = "BACK";
    /**
     * 返回开始节点
     */
    public static final String REJECT = "REJECT";
    /**
     * 转办任务，需要与delegateToUser共同使用
     */
    public static final String DELEGATE = "DELEGATE";
    /**
     * 跳转，需要与targetActivityId共同使用
     */
    public static final String JUMP = "JUMP";

    /**
     * 删除
     */
    public static final String DELETE = "DELETE";

    public static String format(String action) {
        if(COMPLETE.equals(action)){
            return "完成";
        }else if(BACK.equals(action)){
            return "回退";
        }else if(REJECT.equals(action)){
            return "驳回";
        }else if(DELEGATE.equals(action)){
            return "转办";
        }else if(DELETE.equals(action)){
            return "撤销";
        }else if(JUMP.equals(action)){
            return "跳转";
        }
        return action;
    }
}
